<div th:fragment="header" xmlns:th="http://www.thymeleaf.org">
<header class="main-header">
    <a href="#" class="logo">
        <!-- mini logo for sidebar mini 50x50 pixels -->
        <span class="logo-mini"><b>新疆</b></span>
        <!-- logo for regular state and mobile devices -->
        <span class="logo-lg"><b>新疆跨境系统</b></span>
    </a>
    <nav class="navbar navbar-static-top" role="navigation">
        <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
                <li class="dropdown">
                    <a class="dropdown-toggle" href="#" data-toggle="dropdown">
                        <span class="hidden-xs" id = "user"></span><i class="fa fa-gears"></i>
                    </a>
                    <ul class="dropdown-menu nav nav-pills nav-stacked">
                        <li class="dropdown-item">
                            <a th:href="@{/logout}" style="color:#333333">退出</a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
</header>
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $.ajax({
                type: "GET",
                url: "[[@{/user/info}]]",
                contentType : "application/json",
                success: function (result) {
                    if(result.status)
                    {
                        $("#user").html(result.data.id + " / " + result.data.userName);
                    }else{
                        console.log(result.message);
                    }
                },
                error: function (e) {
                    console.log("get user info error");
                }
            });
        });
    </script>
</div>